package com.jwds.digital.bios.business.service.service.belt.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jwds.digital.bios.business.core.exceptions.RecordNotFoundException;
import com.jwds.digital.bios.business.core.infrastructure.dto.belt.BeltRouteHistoryDayDTO;
import com.jwds.digital.bios.business.core.infrastructure.entity.belt.BeltRouteHistoryDay;
import com.jwds.digital.bios.business.core.infrastructure.mapper.belt.BeltRouteHistoryDayMapper;
import com.jwds.digital.bios.business.core.infrastructure.vo.belt.BeltRouteHistoryDayVO;
import com.jwds.digital.bios.business.service.service.belt.IBeltRouteHistoryDayService;
import com.jwds.tdc.framework.application.lib.page.PageRequest;
import com.jwds.tdc.framework.application.lib.page.PageResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 线路效能天表实现类
 * @author 席鹏程
 * @date 2024-11-14
 */
@Slf4j
@Service
public class BeltRouteHistoryDayServiceImpl extends ServiceImpl<BeltRouteHistoryDayMapper, BeltRouteHistoryDay> implements IBeltRouteHistoryDayService {

    @Autowired
    private BeltRouteHistoryDayMapper baseMapper;

    @Override
    public PageResponse<BeltRouteHistoryDayVO> page(PageRequest<BeltRouteHistoryDayDTO> request) {
        BeltRouteHistoryDayDTO condition = request.getQueryCondition();
        Page<BeltRouteHistoryDayVO> page = new Page<>(request.getPageIndex(), request.getPageSize());
        IPage<BeltRouteHistoryDayVO> pageData = baseMapper.pageQuery(page, condition);
        return new PageResponse<>((Page<?>)pageData, pageData.getRecords());
    }

    @Override
    public List<BeltRouteHistoryDayVO> list(BeltRouteHistoryDayDTO reqDto) {
        return baseMapper.queryList(reqDto);
    }

}